package priv.yiyuan.example.design;

import priv.yiyuan.example.design.device.Device;

/**
 * 关闭命令对象
 * <p>
 * 命令模式(具体命令)
 *
 * @author YiYuan
 * @data 2025/8/20
 * @apoNote
 */
public class TurnOffCommand implements Command {

    private Device device;

    public TurnOffCommand(Device device) {
        this.device = device;
    }

    @Override
    public void execute() {
        device.turnOff();
    }

    @Override
    public void undo() {
        device.turnOn();
    }
}
